2D Snapshot Readibility of centroid circles and labels#87
Merged
Conversation
…s gray or black border depending on its color. made text larger, so that the snapshots are better readable
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR improves the 2D snapshot readability by enhancing the contrast and size of centroid circles and their labels.
- Introduces a new utility function to select contrasting stroke colors.
- Increases centroid circle radius and updates text styling with stroke effects.
- Adjusts arrow color computation (though the modulo arithmetic uses a mismatched variable).
Comments suppressed due to low confidence (2)
TPTBox/spine/snapshot2D/snapshot_modular.py:508
- The expression for computing the arrow color uses 'color - 1 % LABEL_MAX % cmap.N', but 'color' is already a mapped color from cmap. Consider using the same index calculation as for circles (e.g., (k1 - 1) % LABEL_MAX % cmap.N) to ensure consistent coloring.
axs.add_patch(FancyArrow(v[1] * zms[1], v[0] * zms[0], c, d, color=cmap(color - 1 % LABEL_MAX % cmap.N)))
TPTBox/spine/snapshot2D/snapshot_modular.py:587
- The arrow color calculation uses 'color - 1 % LABEL_MAX % cmap.N' where 'color' has already been set via cmap. To maintain consistency with other elements, use the appropriate index (e.g., (k1 - 1) % LABEL_MAX % cmap.N) for determining the arrow color.
axs.add_patch(FancyArrow(v[2] * zms[2], v[0] * zms[0], c, d, color=cmap(color - 1 % LABEL_MAX % cmap.N)))
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
added contrasting color function to give text of centroids and circles gray or black border depending on its color. made text larger, so that the snapshots are better readable